import java.io.Serializable;

public class Utterance implements Serializable {
	
	public Utterance() {
		super();
	}

	//unique id
	private int id;
	
	private String msgId;

	public String getMsgId() {
		if(msgId== null) 
			return "0";
		return msgId;
	}

	public void setMsgId(String msgId) {
		this.msgId = msgId;
	}

	// id of referenced utterance
	private String refMsgId;
	
	private int refId;

	private String userId;

	// id of participant to whom he is speaking
	private String refUserId;
	
	public String getRefUserId() {
		if(refUserId == null)
			return "0";
		if(refUserId!=null)
			return refUserId.trim().replaceAll(" ", "_");
		return null;
	}

	public void setRefUserId(String refUserId) {
		this.refUserId = refUserId;
	}

	private String subject;

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	private String text = "";
	
	private String utteranceTime;
	
	private Integer level;

	private String topicId;
	
	public String getTopicId() {
		return topicId;
	}

	public void setTopicId(String topicId) {
		this.topicId = topicId;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}


	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getUtteranceTime() {
		return utteranceTime;
	}
	public void setUtteranceTime(String utteranceTime) {
		this.utteranceTime = utteranceTime;
	}


	public String getRefMsgId() {
		if(refMsgId== null) 
			return "0";
		return refMsgId;
	}

	public void setRefMsgId(String refMsgId) {
		this.refMsgId = refMsgId;
	}

	public int getRefId() {
		return refId;
	}

	public void setRefId(int refId) {
		this.refId = refId;
	}

	public String getUserId() {
		if(userId == null)
			return "0";
		return userId.trim().replaceAll(" ", "_");
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public Utterance(int id, String topicId) {
		super();
		this.id 		= id;
		this.topicId 	= topicId;
	}
	
}
